import request from '../utils/request.js'

/**
 * 获取笔记分类
 */
export const getArticleTypeAPI = () => request.get('/article/getArticleType', {})

/**
 * 上传图片到预览表
 */
export const uploadImgAPI = (file) => request.post('/article/uploadImg', {
    file
})

/**
 * 点击保存/发布按钮把笔记信息上传到笔记表
 */
export const uploadArticleAPI = (article, user, type, insertId) => request.post('/article/uploadArticle', {
    article,
    user,
    type,
    insertId
})

/**
 * 获取已保存的笔记
 */
export const getSaveArticleAPI = (user_id) => request.get('/article/getSaveArticle', {
    user_id
})